/*
	Filename	:	bjAction.h
	Author(s)	:	Ray E. Bornert II
	Date		:	2002-MAY-16
	Copyright	:	(c) 2002 RealTimeGaming

	History		:
*/

//////////
// GATE //
//////////
#ifndef _BJACTION_H_
#define _BJACTION_H_

/////////////
// FORWARD //
/////////////
class BJAction;
class ODBCQuery;

//////////////
// INCLUDES //
//////////////
#include "lib.h"
#include "bjhand.h"

/////////////
// DEFINES //
/////////////
//the defined player actions in the game of BlackJack

/// [2013-07-10] Charles. Modified for supporting 'Zappit Rackcard'.
enum	GameAction	{ Bet, Hit, Stand, Double, Split, Surrender, Zap, EOG, MAXACTION };

////////////
// OBJECT //
////////////
class BJAction
{
/////////////
// MEMBERS //
/////////////

private://MEMBERS
	char		m_who;		//dealer or player
	GameAction	m_action;
	int			m_minHands;
	int			m_maxHands;
	int			m_minCards;
	int			m_maxCards;
	int			m_minTotal;
	int			m_maxTotal;
	int			m_minSoft;
	int			m_maxSoft;
	char		m_pattern2[4]; //1st card
	char		m_pattern[44]; //21 cards

public:	//MEMBERS

/////////////
// METHODS //
/////////////

private://METHODS

	int IsPattern();
	int IsPattern2();

public:	//METHODS

	BJAction();
	~BJAction();

	void SetAction
	(
		char		who,
		GameAction	action,
		int			minHands,
		int			maxHands,
		int			minCards,
		int			maxCards,
		int			minTotal,
		int			maxTotal,
		int			minSoft,
		int			maxSoft,
		char*		pPattern2,
		char*		pPattern //21 cards
	);

	int IsAllowed
	(
		char		who,
		GameAction	action,
		int			nHands,
		int			nCards,
		int			total,
		int			softness,
		unsigned char* pCards
	);

	int IsAllowed
	(
		char		who,
		GameAction	action,
		BJHand*		pHand,
		int			nHands
	);

	int ImportFromQuery(  ODBCQuery* query );
	int SetAction( char* actionName );
	int IsOffered( char who, GameAction action );

};


#endif